package com.lnsf.bookstore.web.serachHistory.service.impl;

import com.lnsf.bookstore.web.serachHistory.dao.ApiSerachHistoryMapper;
import com.lnsf.bookstore.web.serachHistory.service.ApiSearchHistoryService;
import com.lnsf.bookstore.web.serachHistory.vo.ApiSerachHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ApiSearchHistoryServiceImpl implements ApiSearchHistoryService{

    @Autowired
    private ApiSerachHistoryMapper apiSerachHistoryMapper;


    public ApiSerachHistory queryObject(Integer id) {
        return apiSerachHistoryMapper.queryObject(id);
    }


    public List<ApiSerachHistory> queryList(Map<String, Object> map) {
        return apiSerachHistoryMapper.queryList(map);
    }


    public int queryTotal(Map<String, Object> map) {
        return apiSerachHistoryMapper.queryTotal(map);
    }


    public void save(ApiSerachHistory apiSerachHistory) {
        apiSerachHistoryMapper.insertSelective(apiSerachHistory);
    }


    public void update(ApiSerachHistory apiSerachHistory) {
        apiSerachHistoryMapper.updateByPrimaryKeySelective(apiSerachHistory);
    }


    public void delete(Integer id) {
        apiSerachHistoryMapper.deleteByPrimaryKey(id);
    }


    public void deleteBatch(Integer[] ids) {
        apiSerachHistoryMapper.deleteBatch(ids);
    }

    public void deleteByUserId(Integer userId) {
        apiSerachHistoryMapper.deleteByUserId(userId);
    }
}
